home *** CD-ROM | disk | FTP | other *** search
/ The Electronic Whole Earth Catalog / ElectronicWholeEarthCatalog.img / WHOLE EARTH / stack.txt < prev   
Text File  |  1989-02-01  |  6KB  |  213 lines

  1. -- stack: in
  2. -- format: 8 (HyperCard 1)
  3. -- flags: 0x1000 (none)
  4. -- protect password hash: 0
  5. -- maximum user level: 5 (scripting)
  6. -- window: Rect(x1=0, y1=0, x2=0, y2=0)
  7. -- screen: Rect(x1=0, y1=0, x2=0, y2=0)
  8. -- card dimensions: w=0 h=0
  9. -- scroll: x=0 y=0
  10. -- background count: 2
  11. -- first background id: 4091
  12. -- card count: 2
  13. -- first card id: 3797
  14. -- list block id: 4479
  15. -- print block id: 3547
  16. -- font table block id: 0
  17. -- style table block id: 0
  18. -- free block count: 0
  19. -- free size: 0 bytes
  20. -- total size: 53792 bytes
  21. -- stack block size: 25088 bytes
  22. -- created by hypercard version: 0x01208000
  23. -- compacted by hypercard version: 0x01208000
  24. -- modified by hypercard version: 0x01208000
  25. -- opened by hypercard version: 0x01228000
  26. -- patterns[0]: 0x0000000000000000
  27. -- patterns[1]: 0x8000000008000000
  28. -- patterns[2]: 0x8800220088002200
  29. -- patterns[3]: 0x8888222288882222
  30. -- patterns[4]: 0x88AA22AA88AA22AA
  31. -- patterns[5]: 0xCCAA33AACCAA33AA
  32. -- patterns[6]: 0xEEAABBAAEEAABBAA
  33. -- patterns[7]: 0xEEBBBBEEEEBBBBEE
  34. -- patterns[8]: 0xFFBBFFEEFFBBFFEE
  35. -- patterns[9]: 0xFFBBFFFFFFBBFFFF
  36. -- patterns[10]: 0x8010022001084004
  37. -- patterns[11]: 0xFFFFFFFFFFFFFFFF
  38. -- patterns[12]: 0x8822882288228822
  39. -- patterns[13]: 0x1122448811224488
  40. -- patterns[14]: 0xC4800C6843023026
  41. -- patterns[15]: 0xB130031BD8C00C8D
  42. -- patterns[16]: 0xAA00AA00AA00AA00
  43. -- patterns[17]: 0x8822552288225522
  44. -- patterns[18]: 0x8855225588552255
  45. -- patterns[19]: 0x77DD77DD77DD77DD
  46. -- patterns[20]: 0x8000000000000000
  47. -- patterns[21]: 0xAA55AA55AA55AA55
  48. -- patterns[22]: 0x038448300C020101
  49. -- patterns[23]: 0x8244394482010101
  50. -- patterns[24]: 0x8814224188412214
  51. -- patterns[25]: 0x8080413E080814E3
  52. -- patterns[26]: 0x22048C7422179810
  53. -- patterns[27]: 0xBE808808EB088880
  54. -- patterns[28]: 0x25C8328964244C92
  55. -- patterns[29]: 0xA29C41BE2AC914EB
  56. -- patterns[30]: 0x40A00000040A0000
  57. -- patterns[31]: 0x8040200002040800
  58. -- patterns[32]: 0xAA00800088008000
  59. -- patterns[33]: 0xFF80808080808080
  60. -- patterns[34]: 0x081C22C180010204
  61. -- patterns[35]: 0xFF808080FF080808
  62. -- patterns[36]: 0xF87422478F172271
  63. -- patterns[37]: 0xBF00BFBFB0B0B0B0
  64. -- patterns[38]: 0xFF7FBE5DA2418000
  65. -- patterns[39]: 0xFAF5FAF5A050A050
  66. -- checksum: 0x0
  67. ----- HyperTalk script -----
  68. -- 12/712/88 we only need to hide the menubar on entry, and to have
  69. -- sound scripts for the surprise sound buttons
  70. on openStack
  71.   global curSnd, sndRefNum
  72.  
  73.   hide menuBar
  74.   put 0 into sndRefNum
  75.   put empty into curSnd
  76. end openStack
  77.  
  78. on doMenu menuChoice
  79.   if menuChoice = "Help" then
  80.     goHelp
  81.   else
  82.     pass doMenu
  83.   end if
  84. end doMenu
  85.  
  86. on goHelp
  87.   put short name of this bg into bgName
  88.   if bgname = "Section Map" then
  89.     put "Domain" into bgName
  90.   else if bgName = "Cluster Map" then
  91.     put "Section" into bgName
  92.   else if bgName = "Item Map" then
  93.     put "Cluster" into bgName
  94.   end if
  95.  
  96.   put showHelp(bgName) into choice
  97.  
  98.   if choice = 1 then
  99.     go to card id 63283 of stack "Introduction"
  100.   else if choice = 2 then
  101.     go to stack "Help"
  102.   end if
  103. end goHelp
  104.  
  105. ------------------------------ Sound Scripts ------------------------------
  106. on initSound
  107.   global curSnd, sndRefNum
  108.  
  109.   put 0 into sndRefNum
  110.   put empty into curSnd
  111. end initSound
  112.  
  113. function openSound shortname
  114. put the long name of this stack into foo
  115. delete first word of foo
  116. delete first char of foo
  117. delete last char of foo
  118. repeat with i = length(foo) down to 1
  119.   if char i of foo is ":" then exit repeat
  120. end repeat
  121. put (char 1 to i of foo) & shortname into bar
  122. return OpenRes(bar)
  123. end openSound
  124.  
  125. on idle
  126.   global curSnd, curChunk
  127.  
  128.   if curSnd is not empty then
  129.     put curSnd & "." & curChunk into chunkName
  130.  
  131.     if the sound is chunkName then
  132.       add 1 to curChunk
  133.       play curSnd & "." & curChunk
  134.     else if the sound is "done" then
  135.       get curSnd
  136.       put empty into curSnd
  137.       set hilite of card button ("Sound " & it) to false
  138.     end if
  139.   end if
  140.  
  141.   pass idle
  142. end idle
  143.  
  144. on playLong sndName
  145.   global curSnd, curChunk, sndRefNum
  146.  
  147.   if curSnd is not empty then
  148.     stopSnd
  149.   else
  150.     put char 1 to 2 of sndName into prefix
  151.     -- special case for down home records
  152.     if prefix is "dh" OR prefix is "DH" then
  153.       put char 3 to 4 of sndName into num
  154.       if num > 35 then put "d2" into prefix
  155.       else put "d1" into prefix
  156.     end if
  157.     put openSound( "SoundFiles:" & prefix & ".chunx" ) into sndRefNum
  158.  
  159.     put sndName into curSnd
  160.     set hilite of card button ("Sound " & curSnd) to true
  161.     put 1 into curChunk
  162.  
  163.     play curSnd & "." & curChunk
  164.  
  165.   end if
  166. end playLong
  167.  
  168. on stopSnd
  169.   global curSnd, curChunk
  170.  
  171.   play stop
  172.  
  173.   if curSnd is not empty
  174.   then
  175.   set hilite of card button ("Sound " & curSnd) to false
  176. end if
  177.  
  178. put empty into curSnd
  179. put 0 into curChunk
  180. end stopSnd
  181.  
  182. on soundCloseCard
  183.   global sndRefNum
  184.  
  185.   stopSnd
  186.   if sndRefNum is not 0 then
  187.     closeRes sndRefNum
  188.   end if
  189.   put 0 into sndRefNum
  190. end soundCloseCard
  191.  
  192. on newSoundBtn sndCode
  193.   -- authoring script to create a new sound button to play 'sndCode' resource
  194.   doMenu "New Button"
  195.   put "Sound" && sndCode into sndBtnName
  196.   set the name of last button to sndBtnName
  197.   set the style of btn sndBtnName to transparent
  198.   set the icon of btn sndBtnName to 13667   -- musical note icon id
  199.   set the rect of btn sndBtnName to "291,301,329,337"
  200.   set the autoHilite of btn sndBtnName to true
  201.   set the showName of btn sndBtnName to false
  202.  
  203.   put "on mouseUp" & return into sndScript
  204.   put "  playLong" && sndCode & return after sndScript
  205.   put "end mouseUp" & return after sndScript
  206.  
  207.   set the script of btn sndBtnName to sndScript
  208.  
  209.   choose Browse tool
  210. end newSoundBtn
  211.  
  212.  
  213.